package com.itheima.service.impl;

import com.itheima.dao.UserMapper;
import com.itheima.pojo.Staff;
import com.itheima.service.StaffService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffServiceImpl implements StaffService {
    private UserMapper userMapper;

    // 查询所有
    public List<Staff> selectAll() {

        return userMapper.queryAll();
    }


    // 添加新用户数据
    public void insertStaff(Staff staff) {
        userMapper.insertNewUser(staff);
    }




    // 根据ID查询用户的行程数据
    public Staff journey(Long id) {
        return userMapper.queryAllById(id);
    }


    //根据ID修改用户的行程数据
    public int updateStaff(Staff staff) {
        return userMapper.updateUserById(staff);
    }


    // 根据ID删除用户的行程数据
    public int deleteUser(Long id) {
        return userMapper.deleteUserById(id);
    }
}
